#define  _CRT_SECURE_NO_WARNINGS



#include<stdio.h>
#include<stdlib.h>


int cmp(const void* e1, const void* e2)
{
    return *(int*)e2 - *(int*)e1;
}
int main()
{
    int n = 0, i = 0, arr[1000] = { 0 }, a[5] = { 0 }, max = 0;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
        if (arr[i] >= 90 && arr[i] <= 100)
            a[0]++;
        else if (arr[i] >= 80 && arr[i] < 90)
            a[1]++;
        else if (arr[i] >= 70 && arr[i] < 80)
            a[2]++;
        else if (arr[i] >= 60 && arr[i] < 70)
            a[3]++;
        else if (arr[i] >= 0 && arr[i] < 60)
            a[4]++;
    }
    for (i = 0; i < 5; i++)
    {
        printf("%d ", a[i]);
        if (a[i] > a[max])
            max = i;
    }
    printf("\n%d\n", a[max]);
    qsort(arr, n, sizeof(int), cmp);
    if (max == 0)
    {
        for (i = 0; i < n; i++)
        {
            if (arr[i] >= 90 && arr[i] <= 100)
                printf("%d ", arr[i]);
        }
    }
    else if (max == 1)
    {
        for (i = 0; i < n; i++)
        {
            if (arr[i] >= 80 && arr[i] < 90)
                printf("%d ", arr[i]);
        }
    }
    else if (max == 2)
    {
        for (i = 0; i < n; i++)
        {
            if (arr[i] >= 70 && arr[i] < 80)
                printf("%d ", arr[i]);
        }
    }
    else if (max == 3)
    {
        for (i = 0; i < n; i++)
        {
            if (arr[i] >= 60 && arr[i] < 70)
                printf("%d ", arr[i]);
        }
    }
    else
    {
        for (i = 0; i < n; i++)
        {
            if (arr[i] >= 0 && arr[i] < 60)
                printf("%d ", arr[i]);
        }
    }
    return 0;
}